home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 2 / Tech Arsenal 2 (Arsenal Computer).iso / clipper / s93bsp.exe / CL5 / INVSLCT.PRG < prev    next >
Encoding:
Text File  |  1993-11-26  |  3.1 KB  |  117 lines

  1. ///////////////////////////////////////////////////////////////
  2. //
  3. //  Module : INVSLCT.PRG
  4. //
  5. //  Created by SUMMER'93 (c) on Fri Nov 26 14:51:30 1993
  6. //
  7. ///////////////////////////////////////////////////////////////
  8. #include "snj.ch"
  9. // The following vars were made static because they were 'inherited'
  10. // IVFLDS 
  11. // The following statics were declared 'PUBLIC' in the S87 code
  12. // OR were private and inherited by called functions
  13. // If they are used outside this module there will be a set/get
  14. // function with the same name as the var in this module
  15. static IVFLDS [ 4 ]
  16. function INVOWNGT( SEEKVAR ) // Amended by SUMMER93
  17. // Calls: CTPRMT2 IVFUNC 
  18. // Called By: GINVNO 
  19. //       I N V O W N G T
  20. //       Routine to search out a customer
  21.  
  22. // The following locals have been declared by Summer'93
  23. // KOUNT 
  24. local IVFUNC, OLDSCR, IVHDRS [ 4 ], KOUNT
  25.  
  26.  
  27.  
  28. save screen to OLDSCR 
  29. select INVOICE 
  30.  
  31. IVHDRS[ 1 ] := "Invoice" 
  32. IVFLDS[ 1 ] := "INVNO" 
  33. IVHDRS[ 2 ] := "Owner name" 
  34. IVFLDS[ 2 ] := "OWNNAME" 
  35. IVHDRS[ 3 ] := "Reg. No" 
  36. IVFLDS[ 3 ] := "REGNO" 
  37. IVHDRS[ 4 ] := "Date in" 
  38. IVFLDS[ 4 ] := "DATEIN" 
  39. set softseek on 
  40. set deleted on 
  41. //   Determine which index we're using and set a low limit
  42. if eof( ).or. empty( SEEKVAR )
  43.     SEEKVAR := iif( isalpha(alltrim(SEEKVAR )).or. empty(SEEKVAR ), "!", ;
  44.     "    1" )
  45.     seek SEEKVAR 
  46. else  // Position in middle of screen - maybe
  47.     KOUNT := 5 
  48.     do while INVOICE->INVNO <> 0 .and. KOUNT > 0 .and. !bof( )
  49.         KOUNT := KOUNT - 1 
  50.         skip - 1 
  51.     enddo 
  52.     keyboard replicate( chr(24 ), 5  - KOUNT )
  53. endif 
  54.  
  55. @ 7, 10, 20, 64 box replicate( chr(177 ), 9 )
  56. @ 8, 12 clear to 19, 62 
  57.  
  58. set color to( COLBRIGHT() )
  59. do while !GETOUT() 
  60.     do CTPRMT2
  61.     dbedit( 8, 12, 19, 62, IVFLDS, "IVFUNC", .t., IVHDRS, chr(196 ), chr(179 );
  62.     )
  63. enddo 
  64.  
  65. GETOUT( .f.  )
  66. restore screen from OLDSCR 
  67. return( MINVNO() )
  68.  
  69. //**********************************************************************
  70.  
  71. function IVFUNC( MODE, FLD_PTR ) // Amended by SUMMER93
  72. // Calls: QBYESNO CTPRMT2 
  73. // Called By: INVOWNGT 
  74. // The following locals have been declared by Summer'93
  75. // ROWNO COLNO 
  76. local CURREC, CURFLD, MEDSTR, ROWNO, COLNO
  77.  
  78. CURREC := recno( )
  79. ROWNO := row( )
  80. COLNO := col( )
  81.  
  82. QBKEY( lastkey( ) )
  83. clear typeahead 
  84. do case 
  85.     case MODE < 4 
  86.         if INVOICE->INVNO  = 0 
  87.             keyboard chr( 24 )
  88.         endif 
  89.         return 1 
  90.     case QBKEY()  = 27 
  91.         
  92.         MOWNNAME( ""  )
  93.         MINVNO( 0  )
  94.         GETOUT( .t.  )
  95.         return 0 
  96.     case QBKEY()  = 13 
  97.         save screen 
  98.         CURFLD := IVFLDS[ FLD_PTR ] 
  99.         MEDSTR := INVOICE->&CURFLD 
  100.         set color to( COLFLASH() )
  101.         @ ROWNO, COLNO say MEDSTR 
  102.         if QBYESNO( "Select this Invoice? (Y/N)" ) = "Y" 
  103.             MINVNO( INVOICE->INVNO  )
  104.             GETOUT( .t.  )
  105.             return 0 
  106.         endif 
  107.         set color to( COLBRIGHT() )
  108.         restore screen 
  109.     otherwise 
  110.         clear typeahead 
  111.         do CTPRMT2
  112.         return 1 
  113. endcase 
  114.  
  115. return 0 
  116. // End of file
  117.